// import { getMessage } from '@/api/system'
import { Message } from 'element-ui'
import Vue from 'vue'

const state = {
  gradeOptions: [
  	{
  		label: "A(重点客户)",
  		value: "A"
  	},
  	{
  		label: "B(优质客户)",
  		value: "B"
  	},
  	{
  		label: "C(普通客户)",
  		value: "C"
  	},
  ],
  platformOptions: [
  	{
  		label: "淘宝专卖店",
  		value: 1
  	},
  	{
  		label: "京东专卖店",
  		value: 2
  	},
  	{
  		label: "拼多多专卖店",
  		value: 3
  	},
  ],
}

const mutations = {
  // SET_REMINDS: (state, reminds) => {
  //   state.reminds = reminds
  // },
  // SET_REMINDUNREADCOUNT: (state, remindUnreadCount) => {
  //   state.remindUnreadCount = remindUnreadCount
  // },
}

const actions = {

  // messageList({ commit }, update) {
  //   // Promise 异步操作，resolve成功回调，reject失败回调
  //   return new Promise((resolve, reject) => {
  //     getMessage().then(response => {
  //       // console.log(response);
  //       const data = response.result
          
  //       commit('SET_REMINDS', data.data)
  //       commit('SET_REMINDUNREADCOUNT', data.unreadCount)

        
  //       if (update) {
  //         Message.success({
  //           type: 'success',
  //           message: '您收到了新的消息，请及时查看。',
  //           customClass: "my-message",
  //           duration: 3000,
  //         });
  //       }
  //       resolve()
  //     }).catch(error => {
  //       reject(error)
  //     })
  //   })
  // },
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}